package cn.elricyu.kf.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity(name = "FarmUser")
@Table(name = "FarmUser")
@NamedQueries( {
		@NamedQuery(name = "FarmUser.findUserByUserId", query = "SELECT user "
				+ "FROM FarmUser user " + "WHERE user.userId = :userId"),
		@NamedQuery(name = "FarmUser.getAllUser", query = "SELECT users "
				+ "FROM FarmUser users ") })
public class User {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;

	@Column(name = "site", nullable = false, length = 20)
	private String site;// taobao,xiaonei,baidu

	@Column(name = "userId", nullable = false, length = 40)
	private String userId;

	@Column(name = "userName", nullable = false, length = 40)
	private String userName;

	@Column(name = "gmtCreate")
	private Date gmtCreate = new Date();

	@Column(name = "gmtUpdate")
	private Date gmtUpdate;
	
	public Long getId() {
		return id;
	}

	public String getSite() {
		return site;
	}

	public void setSite(String site) {
		this.site = site;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Date getGmtCreate() {
		return gmtCreate;
	}

	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	public Date getGmtUpdate() {
		return gmtUpdate;
	}

	public void setGmtUpdate(Date gmtUpdate) {
		this.gmtUpdate = gmtUpdate;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
